package com.hand.demo.infra.util;

import io.choerodon.core.oauth.CustomUserDetails;
import io.choerodon.core.oauth.DetailsHelper;
import org.hzero.boot.scheduler.infra.annotation.JobHandler;
import org.hzero.boot.scheduler.infra.enums.ReturnT;
import org.hzero.boot.scheduler.infra.handler.IJobHandler;
import org.hzero.boot.scheduler.infra.tool.SchedulerTool;

import java.util.Map;

/**
 * 与调度平台的jobhandler对应
 * 执行器类，执行方法
 * @author yufan.yao@hand-china.com yyf 2023/9/23
 */
/*@JobHandler("demo-44200")
public class Execute implements IJobHandler {

    @Override
    public ReturnT execute(Map<String, String> map, SchedulerTool tool) {
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
        }
        //刷新任务进度以及描述
        tool.updateProgress(100,"任务进行中");
        //日志记录
        Long belongTenantId = tool.getBelongTenantId();
        tool.info("任务一执行成功!,租户id为"+belongTenantId);
        //获取用户详情
        CustomUserDetails userDetails = DetailsHelper.getUserDetails();
        return ReturnT.SUCCESS;
    }
}*/
